export const TYPE = {
    SET_TOKEN: 'setToken'
}

const initState: { token: string | null } = {
    token: localStorage.getItem('token')
}
const loginReducer = (state = initState, action: any) => {
    switch (action.type) {
        case TYPE.SET_TOKEN:
            return { ...state, token: action.token };
        default:
            return state;
    }
};

export default loginReducer;